package edu.pitt.dbmi.odie.gapp.gwt.client.analysis;

import java.util.Date;

import com.google.gwt.user.client.rpc.IsSerializable;

public class ODIE_AnalysisDAO implements IsSerializable {

	private String odieId;

	private String userId ;
	
	private String directoryHandle;

	private String title;
	
	private String analysisStatus;

	private Date creationDate;
	
	private Date modifiedDate;

	private Integer unitsRequested;
	
	private Integer unitsCompleted;
	
	private String processingUnitName;
	
	private Integer subUnitsRequested;
	
	private Integer subUnitsCompleted;
	
	private String processingSubUnitName;
	
	private boolean isSelected;
	
	public ODIE_AnalysisDAO() {
	}

	public String getOdieId() {
		return this.odieId;
	}

	public void setOdieId(String odieId) {
		this.odieId = odieId;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId ;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getDirectoryHandle() {
		return directoryHandle;
	}

	public void setDirectoryHandle(String directoryHandle) {
		this.directoryHandle = directoryHandle;
	}

	public Date getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}
	
	public String getAnalysisStatus() {
		return analysisStatus;
	}

	public void setAnalysisStatus(String analysisStatus) {
		this.analysisStatus = analysisStatus;
	}

	public Date getModifiedDate() {
		return modifiedDate;
	}

	public void setModifiedDate(Date modifiedDate) {
		this.modifiedDate = modifiedDate;
	}

	public Integer getUnitsRequested() {
		return unitsRequested;
	}

	public void setUnitsRequested(Integer unitsRequested) {
		this.unitsRequested = unitsRequested;
	}

	public Integer getUnitsCompleted() {
		return unitsCompleted;
	}

	public void setUnitsCompleted(Integer unitsCompleted) {
		this.unitsCompleted = unitsCompleted;
	}

	public String getProcessingUnitName() {
		return processingUnitName;
	}

	public void setProcessingUnitName(String processingUnitName) {
		this.processingUnitName = processingUnitName;
	}
	
	public Integer getSubUnitsRequested() {
		return subUnitsRequested;
	}

	public void setSubUnitsRequested(Integer subUnitsRequested) {
		this.subUnitsRequested = subUnitsRequested;
	}

	public Integer getSubUnitsCompleted() {
		return subUnitsCompleted;
	}

	public void setSubUnitsCompleted(Integer subUnitsCompleted) {
		this.subUnitsCompleted = subUnitsCompleted;
	}

	public String getProcessingSubUnitName() {
		return processingSubUnitName;
	}

	public void setProcessingSubUnitName(String processingSubUnitName) {
		this.processingSubUnitName = processingSubUnitName;
	}

	public boolean isSelected() {
		return isSelected;
	}

	public void setSelected(boolean isSelected) {
		this.isSelected = isSelected;
	}

	public String toXml() {
		StringBuffer sb = new StringBuffer();
		if (getOdieId() != null) {
	        sb.append("<analysis>") ;
			sb.append("<odieId>" + getOdieId() + "</odieId>");
			sb.append("<userId>" + getUserId() + "</userId>") ;
			sb.append("<title>" + getTitle() + "</title>");
			sb.append("<analysisStatus>" + getAnalysisStatus() + "</analysisStatus>");
			sb.append("<unitsRequested>" + getUnitsRequested() + "</unitsRequested>");
			sb.append("<unitsCompleted>" + getUnitsCompleted() + "</unitsCompleted>");
			sb.append("<progress>" + "" + "</progress>");
			sb.append("<isSelected>" + isSelected() + "</isSelected>") ;
			sb.append("</analysis>") ;
		}
		return sb.toString();
	}

}
